-
Notifications
You must be signed in to change notification settings - Fork 14
chore: force select only the matching guide when forced guide key is set #843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
3ca6b2e to
bfd9122
Compare
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
| @@ -1,2 +1,2 @@ | |||
| nodejs 24.12.0 | |||
| nodejs 24.13.0 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated, upgrading to the same node version we are using in control.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
|
||
| // If in debug mode, put the forced guide at the beginning of the display sequence. | ||
| if (state.debug.forcedGuideKey) { | ||
| const forcedKeyIndex = displaySequence.indexOf(state.debug.forcedGuideKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preview guides not in display sequence cannot be shown
Low Severity
The removal of the displaySequence.unshift(state.debug.forcedGuideKey) logic means guides that exist only in previewGuides (but aren't yet in the display_sequence) can no longer be force-shown. Previously, the forced guide key was always added to the front of the display sequence copy, allowing iteration over keys not originally in the sequence. Now, only keys already in display_sequence are iterated, so a newly-created guide being previewed before publication to a group won't appear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true, and I think we should move toward the behavior where only published guides can be rendered.
|
don't forget a changeset! |



Description
This is prep work ahead of actual Guide Toolbar v2 changes in downstream PRs.
Taking a step back - right now we have a fair amount of Live Preview logic living in the guide client module directly, and it's resulting in a lot of added complexities that I think would be better contained in a separate toolbar/debugging module. I want to pull out as much "debugging" related code out of the guide client, and try to keep to a minimal set of properties the guide client understands to provide debugging behaviors/functionalities.
This PR simplifies the current live preview related logic by only force rendering the target guide when
forcedGuideKeyis present (vs rendering other guides also). This was brought up a few times as a point of confusion when using live preview, so I think this makes sense from both the code and the product perspectives. I think eventually I want to get rid of "live preview" with streaming updates altogether, but that's to be discussed later.